package com.itheima.stock.controller;

import com.itheima.stock.annotation.Limiter;
import com.itheima.stock.api.UserControllerAPI;
import com.itheima.stock.response.ResponseResult;
import com.itheima.stock.service.UserService;
import com.itheima.stock.vo.CaptchaVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zby
 * @created 2024-06-22 22:48
 * @description 用户接口实现
 */
@RestController
public class UserController implements UserControllerAPI {
    @Autowired
    UserService userService;

    @Override
    public String getName() {
        return "itheima";
    }

    @Limiter
    @Override
    public ResponseResult<CaptchaVO> generateCaptcha() {
        return ResponseResult.ok(userService.generateCaptcha());
    }
}